package com.yztstudy.Service.Impl;

import com.yztstudy.Entity.FoodType;
import com.yztstudy.Mapper.FoodTypeMapper;
import com.yztstudy.Service.FoodTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class FoodTypeServiceImpl implements FoodTypeService {

    @Autowired
    private FoodTypeMapper foodTypeMapper;

    @Override
    public Integer addFoodType(FoodType foodType) {
        return foodTypeMapper.addFoodType(foodType);
    }

    @Override
    public Integer deleteFoodType(Integer id) {
        return foodTypeMapper.deleteFoodType(id);
    }

    @Override
    public Integer activeFoodType(Integer id) {
        return foodTypeMapper.activeFoodType(id);
    }

    @Override
    public Integer updateFoodType(FoodType foodType) {
        return foodTypeMapper.updateFoodType(foodType);
    }

    @Override
    public List<FoodType> getFoodTypes(String name) {
        return foodTypeMapper.getFoodTypes(name);
    }

    @Override
    public FoodType getFoodTypeById(Integer id) {
        return foodTypeMapper.getFoodTypeById(id);
    }

    @Override
    public List<FoodType> getAllFoodType() {
        return foodTypeMapper.getAllFoodType();
    }
}
